﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class ePioneer_Center_ep_orders : System.Web.UI.Page
{
    ePioneer_Order epo = new ePioneer_Order();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["EPioneerOrder"] == null)
            {
                Session["EPioneerOrder"] = epo.GetEPioneerOrder();
            }
            List<ePioneer_Order_Model> list = Session["EPioneerOrder"] as List<ePioneer_Order_Model>;
            RepeaterLecturer.DataSource = list;
            RepeaterLecturer.DataBind();
        }
    }

    protected void btn_Serach_Click(object sender, EventArgs e)
    {
        string orderId = txt_OrderNumber.Text.Trim();
        if (Session["EPioneerOrder"] == null)
        {
            Session["EPioneerOrder"] = epo.GetEPioneerOrder();
        }
        List<ePioneer_Order_Model> list = Session["EPioneerOrder"] as List<ePioneer_Order_Model>;
        if (orderId != "")
            list = list.Where(p => p.Ordernumber == orderId).ToList();
        RepeaterLecturer.DataSource = list;
        RepeaterLecturer.DataBind();
    }
}